﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SMT.SagePos.BusinessObjects;

namespace SagePos
{
    public partial class CustomersForm : Form
    {
        public CustomersForm()
        {
            InitializeComponent();
        }

        private void Customers_Load(object sender, EventArgs e)
        {
            Customers customers = new Customers();
            
            List<Customer> clist = new List<Customer>();
            foreach (Customer c in customers) clist.Add(c);

            var v = from o in clist select new { o.FirstName };
            
            //BindingSource bs = new BindingSource();
            //bs.DataSource = v;
            uxCustomerDgv.DataSource = v;
            
        }

        private void uxFirstName_Validating(object sender, CancelEventArgs e)
        {
            if (uxFirstName.Text.Length == 0) uxErrorProvider.SetError(uxFirstName, "First name is a required field");
        }
    }
}
